package com.lap.auth.application.user;

import com.lap.auth.application.user.dto.*;
import com.lap.auth.application.user.repository.UserQueryRepository;
import com.lap.framework.dto.page.PageResponse;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@RequiredArgsConstructor
@Service
public class UserQueryAppService {

  private final UserQueryRepository userQueryRepository;

  public PageResponse<UserWithOrgDto> queryUsersWithOrgByPage(QueryUserPageQuery query) {
    return userQueryRepository.findWithPostPaged(query);
  }

  public PageResponse<UserSimpleDto> querySimplesByPage(QueryUserSimplePageQuery query) {
    return userQueryRepository.findSimplePaged(query);
  }

  public List<UserSimpleDto> queryUsersByIds(GetUserByIdsQuery query) {
    return userQueryRepository.findSimpleByIds(query.getUserSet());
  }
}
